package spring.jpa.proxy

import org.springframework.context.ApplicationContext
import org.springframework.context.annotation.AnnotationConfigApplicationContext
import org.springframework.context.annotation.ComponentScan
import org.springframework.context.annotation.Import

@ComponentScan(basePackages = ["spring.jpa.proxy"])
@Import(JpaRepostoryRegistrar::class)
class SpringApp

fun main() {
    val applicationContext: ApplicationContext =
            AnnotationConfigApplicationContext(SpringApp::class.java)
    val repository = applicationContext.getBean("categoryRepository")
            as JpaRepository
    repository.findById()
}
